package com.wyz.service;

import java.util.List;

import com.wyz.dao.ReviewDao;
import com.wyz.entity.Movie;
import com.wyz.entity.Review;

import my.db.QueryHelper;

public class ReviewService {
	
	private ReviewDao dao = new ReviewDao();
	
	/**
	 * 增加影评
	 * */
	public void save(Review review) {
		dao.save(review);
	}
	
	/**
	 * 删除影评
	 * */
	public void remove(Long reviewId) {
		dao.remove(reviewId);
	}
	
	/**
	 * 修改点赞数
	 * */
	public void addThumb_upAmount(Long reviewId,int amount) {
		dao.addThumb_upAmount(reviewId, amount);
		
	}
	/**
	 * 查询影评
	 * */
	public List<Review> findAll() {
		return dao.findAll();
	}
	
	public List<Review> findByUserId(Long userId){
		return dao.findByUserId(userId);
	}
	public Review findById(Long id) {
		return dao.findById(id);
	}
	public List<Review> findByMovieId(Long movieId){
		return dao.findByMovieId(movieId);
	}
	
}
